{% include variables.md %}
<head>
  <link href="http://gmpg.org/xfn/11" rel="profile">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta http-equiv="content-type" content="text/html; charset=utf-8">

  <!-- Enable responsiveness on mobile devices-->
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">

  <title>
    {% if page.title == "Home" %}
      {{ site.title }} &middot; {{ site.tagline }}
    {% else %}
      {{ page.title }} &middot; {{ site.title }}
    {% endif %}
  </title>

  <!-- CSS -->
  <link rel="stylesheet" href="{{ site.baseurl }}/public/css/bootstrap/bootstrap.min.css">
  <script src="{{ site.baseurl }}/public/js/jquery.min.js"></script>
  <script src="{{ site.baseurl }}/public/js/bootstrap/bootstrap.min.js"></script>
  <script src="{{ site.baseurl }}/public/js/utils.js" id="utils.js" data-latest-version="{{latest_version}}" data-version-list="{{versions | join: " "}}"></script>
  <script src="{{ site.baseurl }}/public/js/scripts.js"></script>
  <link rel="stylesheet" href="{{ site.baseurl }}/public/css/syntax.css">
  <link rel="stylesheet" href="{{ site.baseurl }}/public/css/styles.css">
  <link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700|Abril+Fatface">

  <!-- lightbox -->
  <link href="{{ site.baseurl }}/public/css/featherlight.min.css" type="text/css" rel="stylesheet" />
  <script src="{{ site.baseurl }}/public/js/featherlight.min.js" type="text/javascript" charset="utf-8"></script>
  <script>
  $(document).ready(function(){
          var max = 320;
	  var min = 120;
	  var winWidth = window.innerWidth;

	  function supports_html5_storage() {
		try {
		  return 'localStorage' in window && window['localStorage'] !== null;
		} catch(e) {
		  return false;
		}
	  }

	  function saveSplitState(x) {
	    if (supports_html5_storage()){
		  localStorage.setItem("splitBar", x);
		}
	  }

	  function setSplitBarWidth(x) {
		if (x < max) {
		  if (x < min) {
		  $('#sidebar').css("width", 0);
		  $('#search').css("width", 0);
		  $('#main').css("width", 100 + '%');
		  } else {
		  $('#sidebar').css("width", (x/winWidth * 100) + "%");
		  $('#search').css("width", (x/winWidth * 100) + "%");
		  $('#main').css("width", ((winWidth - x)/winWidth * 100) + "%");
		  }
		} else {
		  $('#sidebar').css("width", (max/winWidth * 100) + "%");
		  $('#search').css("width", (max/winWidth * 100) + "%");
		  $('#main').css("width", ((winWidth - max)/winWidth * 100) + "%");
		}
	  }

	  if (localStorage["splitBar"]) {
		setSplitBarWidth(localStorage["splitBar"]);
	  }

	  $(window).resize(function() {
		winWidth = window.innerWidth;
	  });

	  $('#split-bar').mousedown(function (e) {
		e.preventDefault();
		$(document).mousemove(function (e) {
			e.preventDefault();
			var x = e.pageX - $('#sidebar').offset().left;
			setSplitBarWidth(x);
			saveSplitState(x);
		});
	  });

	  $(document).mouseup(function (e) {
		$(document).unbind('mousemove');
	  });

	  $('.content img').click(function(){
		var content = $(this).attr('src');
		$.featherlight(content);
	  });
	  $('.car-field').click(function(event){
		event.preventDefault();
		$(this).parents("li").toggleClass("menu-opened");
	  });
  });
  </script>
  <!-- lightbox -->

  <!-- google analytics -->
  <script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

  ga('create', '{{site.data.permanent_config.google_analytics_property_id}}', 'auto');
  ga('send', 'pageview');
  </script>
  <!-- google analytics -->

  <!-- Icons -->
  <link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ site.baseurl }}/public/apple-touch-icon-144-precomposed.png">
                                 <link rel="shortcut icon" href="{{ site.baseurl }}/public/favicon.ico">

</head>
